package Test;

import java.util.List;

import shiyan2.Course;
import shiyan2.Student;
import shiyan2.Teacher;

public class Test {
    public static void main(String[] args) {
        Teacher teacher1 = new Teacher("王老师",001,"男");
        Teacher teacher2 = new Teacher("张老师",002,"女");

        Course course1 = teacher1.addCourse(1,"线性代数","2202","8:00");
        Course course2 = teacher1.addCourse(2,"大学物理","2202","10:00");

        Course course3 = teacher2.addCourse(3,"离散数学","教207","13:30");

        Student student1 = new Student("小吴",2021310862,"男");
        Student student2 = new Student("小徐",2021310800,"女");

        student1.selectCourse(course1);
        student1.selectCourse(course2);
        student2.selectCourse(course3);
        
        List<Course> courseList1 = student1.getCourseList();
        System.out.println("学生1【选课】【课程1和课程2】课程信息:");
        for (int i = 0; i < courseList1.size(); i++) {
			Course course = courseList1.get(i);
			System.out.println(
					(i + 1) + ".课程名称:" + course.getClassname() + ",教室：" + course.getSpot() + ",时间：" + course.getTime());
		}
        
        List<Course> courseList2 = student2.getCourseList();
		System.out.println("学生2【选课】【课程3】课程信息:");
		for (int i = 0; i < courseList2.size(); i++) {
			Course course = courseList2.get(i);
			System.out.println("课程名称:" + course.getClassname() + ",教室：" + course.getSpot() + ",时间：" + course.getTime());
		}

        student1.unSelectCourse(course1);
        System.out.println("学生1【退课】【课程1】后课程信息:");
        for (int i = 0; i < courseList1.size(); i++) {
            System.out.println(courseList1.get(i).getClassname());
        }
    }
} 